<!DOCTYPE html>
<html>
<head>
	<style>
		html{
			width : 960px;
			height : 700px;
			background : url('../assets/images/bg_certificate.jpg') no-repeat;
			background-size : 960px 700px;
		}
		body{
			width : 960px;
			height : 700px;
			padding : 0;
			margin : 0;
		}
		.container{
			width : 790px;
			height : 550px;
			margin : 75px 85px 75px 85px;
			display: block;
			position: relative;
		}
		table, tr, td, th{
			text-align:center;
			border:1px solid black;
			border-collapse:collapse;
		}
		h1{
			padding:0;
			margin:0 0 5px 0;
		}
		h2{
			padding:0;
			margin:0 0 10px 0;
		}
		h3{
			padding:0;
			margin:15px 0 15px 0;
		}
		.aspek{
			text-align:left;
			padding-left:5px;
		}
	</style>
</head>
<body>
	<?php
		function get_kualifikasi($nilai){
			if($nilai >= 81 && $nilai <= 100 ){
				return 'Memuaskan';
			}else if($nilai >= 71 && $nilai <= 80 ){
				return 'Sangat Baik';
			}else if($nilai >= 66 && $nilai <= 70 ){
				return 'Baik';
			}else if($nilai >= 61 && $nilai <= 65 ){
				return 'Cukup';
			}else{
				return 'Kurang';
			}
		}
	?>
	<div class="container" style="text-align:center;">
		<h3>A. ASPEK NON TEKNIS</h3>
		<table width="790px" cellspacing="0" cellpadding="0" align="center">
			<tr>
				<th width='50px'>NO.</th>
				<th width='480px'>ASPEK PENILAIAN</th>
				<th width='150px'>NILAI</th>
				<th width='160px'>KUALIFIKASI</th>
			</tr>
			<?php 
			$total = count($records); 
			$num = 1;
			for($inc = 0; $inc < $total; $inc++){ 
				if($records[$inc]->penilaian_jenis == 'Non Teknis'){
			?>
				<tr>
					<td><?=$num++?></td>
					<td class='aspek'><?=$records[$inc]->penilaian_kompetensi?></td>
					<td><?=$records[$inc]->penilaian_nilai?></td>
					<td><?=get_kualifikasi($records[$inc]->penilaian_nilai)?></td>
				</tr>
			<?php } } ?>
		</table>
		<br/><br/>
		<h3>B. ASPEK TEKNIS</h3>
		<table width="790px" cellspacing="0" cellpadding="0" align="center">
			<tr>
				<th width='50px'>NO.</th>
				<th width='480px'>ASPEK PENILAIAN</th>
				<th width='150px'>NILAI</th>
				<th width='160px'>KUALIFIKASI</th>
			</tr>
			<?php 
			$total = count($records); 
			$num = 1;
			for($inc = 0; $inc < $total; $inc++){ 
				if($records[$inc]->penilaian_jenis == 'Teknis'){
			?>
				<tr>
					<td><?=$num++?></td>
					<td class='aspek'><?=$records[$inc]->penilaian_kompetensi?></td>
					<td><?=$records[$inc]->penilaian_nilai?></td>
					<td><?=get_kualifikasi($records[$inc]->penilaian_nilai)?></td>
				</tr>
			<?php } } ?>
		</table>
	</div>
</body>
</html>